Page({
    data: {
        my: {
            name: "xuyang",
            age: 21,
            hobby: ["girls", "games"],
        },
        nameInfo: {},
    },

    onLoad() {
        getApp().setWatcher(this);
        this.data.my.hobby[0] = "study";
        // this.setData({
        //     nameInfo: { name: "haha", sex: "boy" },
        // });
        console.log(this.data);
    },

    watch: {
        my: {
            handler(newValue) {
                console.log("数据更新了", newValue);
            },
            deep: true,
        },
    },
});